package com.tiger.cloud.util;

public enum ErrorCode {

	SUCCESS(0, "成功"),

	ERROR(1, "网络错误"),

	OBJECT_EXITS(2, "对象已存在"),

	OBJECT_NOT_EXITS(3, "对象不存在"),

	USER_PASSWORD_INVALID(4, "密码错误"),

	USER_NAME_INVALID(5, "用户名错误"),

	PARAMETER_INVALID(6, "参数错误"),

	EMAIL_INVALID(7, "邮箱地址无效"),

	USER_NAME_EXITS(8, "用户名已存在"),

	USER_PASSWORD_EXITS(9, "密码已存在"),

	USER_EMAIL_EXITS(10, "已存在该邮箱"),

	USER_PASSWORD_NOT_EQUALS(11, "两次密码输入不一致"),

	USER_NAME_NOT_EQUALS_PASSWORD(12, "用户名和密码不能相同"),

	USER_AGREEMENT(13, "请同意用户协议"),

	FORM_REPEAT_SUBMIT(14, "表单重复提交"),

	CSRF_TOKEN_INVALID(15, "Data connection errors!"),

	DB_CONNECTION_ERROR(16, "Data connection errors!"),

	USER_NOT_LOGINED(17, "用户未登录"),

	NOT_APP_CLIENT(18, "非app客户端请求"),

	NOT_ADMIN_CLIENT(19, "非管理端请求"),

	INTERNAL_ERROR(20, "网络异常"),

	FILE_NOT_FOUNT(21, "文件不存在"),

	FILE_SIZE_LIMIT_EXCEEDED(22, "超过文件大小限制"),

	INVALID_EXTENSION(23, "不支持此类文件上传"),

	FILE_NAME_LENGTH_LIMIT_EXCEEDED(24, "文件名长度超过限制"),

	USER_NOT_PERMISSION(25, "用户无访问权限"),

	ID_CARD_ILLEAGAL(26, "身份证号错误"),

	OPREATION_BEYOND_RANFE(27, "超过数据区间"),

	NOT_CASCADE_DELETE(28, "无法级联删除"),

	INVALID_REQUEST(29, "无效的请求"),

	USER_NOT_LOGINED2(30, "用户已经被禁用!"),

	TOKEN_EXPIRED(100, "token过期,重新访问!"),

	UNKNOWN(2000, "网络错误,请重新操作!"),

	INVALID_ACCESS(10000, "此操作无权限");

	private int code;
	private String message;

	private ErrorCode(int code, String message) {
		this.message = message;
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

}
